<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<!-- 第一种: form表单方式 -->

<form action="search.action" method="post">
	员工名:<input name="ename" value="${param.ename}" />
	<!-- 页面初始化需要获取数据 search_init.action servlet请求
	访问数据库把数据显示出来
	
	
	 -->
	<select name="job">
		<option value="-1">----选择工作---</option>
		<!-- 循环我存在 request attribute中的数据 jlist  -->
			<c:forEach items="${jlist}" var="item">
				<option  ${param.job == item? "selected": ""}   value="${item}">${item}</option>
			</c:forEach>
	</select>
	<button>检索</button>
</form>
<hr />
明细：
<table>
	<tr>
	<th>No</th>
		<th>empno</th>
		<th>ename</th>
		<th>job</th>
		<th>操作</th>
	</tr>
	<c:if test="${not empty elist}">
		<c:forEach items="${elist}" var="item" varStatus="stat">
			<tr>
				<td>${stat.count}</td>
				<td>${item.empno }</td>
				<td>${item.ename }</td>
				<td>${item.job }</td>
				<td>
					<button onclick="gengxin(${item.empno})">更新</button>
				
				</td>
			</tr>
		</c:forEach>
	</c:if>
</table>
<script>
function gengxin(empno) {
	
	window.location.href=empno + "/update.action" 
}

</script>
</body>
</html>